/*
 * Copyright 2007 National Bioinformatics Network
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package dgbCORBA;


/**
* dgbCORBA/_iFunctionalStub.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from dgbCORBA.idl
* Monday, April 23, 2007 5:44:45 PM SAST
*/


/* The functional interface provides caching and lookup services.  This interface is simpler
     because it doesn't require the caller to dynamically examine the return type in order to
     determine return types.  Use this interface for lookup of data types, attribute types,
     concept types, etc.  The interface is also available under the iQuery interface but will
     need the return types to be dynamically unmarshalled by the caller at runtime. */
@SuppressWarnings("serial")
public class _iFunctionalStub extends org.omg.CORBA.portable.ObjectImpl implements dgbCORBA.iFunctional
{

  public dgbCORBA.data_type_t get_data_type (long id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_data_type", true);
                $out.write_ulonglong (id);
                $in = _invoke ($out);
                dgbCORBA.data_type_t $result = dgbCORBA.data_type_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_data_type (id        );
            } finally {
                _releaseReply ($in);
            }
  } // get_data_type

  public dgbCORBA.data_type_t[] get_data_types ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_data_types", true);
                $in = _invoke ($out);
                dgbCORBA.data_type_t $result[] = dgbCORBA.data_type_t_seqHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_data_types (        );
            } finally {
                _releaseReply ($in);
            }
  } // get_data_types

  public dgbCORBA.attribute_t get_attribute_type (long id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_attribute_type", true);
                $out.write_ulonglong (id);
                $in = _invoke ($out);
                dgbCORBA.attribute_t $result = dgbCORBA.attribute_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_attribute_type (id        );
            } finally {
                _releaseReply ($in);
            }
  } // get_attribute_type

  public dgbCORBA.attribute_t[] get_attribute_types ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_attribute_types", true);
                $in = _invoke ($out);
                dgbCORBA.attribute_t $result[] = dgbCORBA.attribute_t_seqHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_attribute_types (        );
            } finally {
                _releaseReply ($in);
            }
  } // get_attribute_types

  public dgbCORBA.concept_t get_concept_type_by_id (long id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_concept_type_by_id", true);
                $out.write_ulonglong (id);
                $in = _invoke ($out);
                dgbCORBA.concept_t $result = dgbCORBA.concept_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_concept_type_by_id (id        );
            } finally {
                _releaseReply ($in);
            }
  } // get_concept_type_by_id

  public dgbCORBA.concept_t get_concept_type_by_name (String name)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_concept_type_by_name", true);
                $out.write_string (name);
                $in = _invoke ($out);
                dgbCORBA.concept_t $result = dgbCORBA.concept_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_concept_type_by_name (name        );
            } finally {
                _releaseReply ($in);
            }
  } // get_concept_type_by_name

  public dgbCORBA.concept_t[] get_concept_types ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_concept_types", true);
                $in = _invoke ($out);
                dgbCORBA.concept_t $result[] = dgbCORBA.concept_t_seqHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_concept_types (        );
            } finally {
                _releaseReply ($in);
            }
  } // get_concept_types

  public dgbCORBA.relation_t get_relation_type_by_id (long id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_relation_type_by_id", true);
                $out.write_ulonglong (id);
                $in = _invoke ($out);
                dgbCORBA.relation_t $result = dgbCORBA.relation_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_relation_type_by_id (id        );
            } finally {
                _releaseReply ($in);
            }
  } // get_relation_type_by_id

  public dgbCORBA.relation_t get_relation_type_by_name (String name)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_relation_type_by_name", true);
                $out.write_string (name);
                $in = _invoke ($out);
                dgbCORBA.relation_t $result = dgbCORBA.relation_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_relation_type_by_name (name        );
            } finally {
                _releaseReply ($in);
            }
  } // get_relation_type_by_name

  public dgbCORBA.relation_t[] get_relation_types ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_relation_types", true);
                $in = _invoke ($out);
                dgbCORBA.relation_t $result[] = dgbCORBA.relation_t_seqHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_relation_types (        );
            } finally {
                _releaseReply ($in);
            }
  } // get_relation_types

  public dgbCORBA.layer_t get_layer_type_by_id (long id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_layer_type_by_id", true);
                $out.write_ulonglong (id);
                $in = _invoke ($out);
                dgbCORBA.layer_t $result = dgbCORBA.layer_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_layer_type_by_id (id        );
            } finally {
                _releaseReply ($in);
            }
  } // get_layer_type_by_id

  public dgbCORBA.layer_t get_layer_type_by_name (String name)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_layer_type_by_name", true);
                $out.write_string (name);
                $in = _invoke ($out);
                dgbCORBA.layer_t $result = dgbCORBA.layer_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_layer_type_by_name (name        );
            } finally {
                _releaseReply ($in);
            }
  } // get_layer_type_by_name

  public dgbCORBA.layer_t[] get_layer_types ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_layer_types", true);
                $in = _invoke ($out);
                dgbCORBA.layer_t $result[] = dgbCORBA.layer_t_seqHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_layer_types (        );
            } finally {
                _releaseReply ($in);
            }
  } // get_layer_types

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:dgbCORBA/iFunctional:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
     s.writeUTF (str);
  }
} // class _iFunctionalStub
